
package com.ives.launcher.model;

import java.util.ArrayList;
import java.util.List;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Bitmap;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.ives.launcher.R;
import com.ives.launcher.view.FloderDialog;
import com.ives.launcher.view.View_Cell;
import com.ives.launcher.view.View_Cell.MOnClickLinstener;

/**
 * 普通文件夹model
 */
public class ItemInfo_Floder extends ItemInfo{
	/**
	 * 所有包含对子项
	 */
	public List<ItemInfo> items= new ArrayList<ItemInfo>();
	
	/**
	 * 是否自定义icon
	 */
	public Bitmap customIcon;


	public ItemInfo_Floder() {
		
	}

	public ItemInfo_Floder(ItemInfo_Floder info) {
		super(info);
		title = info.title.toString();
		customIcon = info.customIcon;
	}


	@Override
	public String toString() {
		return title.toString();
	}
	/**
	 * 返回文件夹的点击事件
	 * @return
	 */
	public View_Cell.MOnClickLinstener makeOnClickLinstener(final Context context,final View_Cell cell){
		View_Cell.MOnClickLinstener listener = new MOnClickLinstener() {
			@Override
			public void onClick() {
				//弹出一个选择文件的对话框
				FloderDialog dialog = new FloderDialog(context,ItemInfo_Floder.this,cell);
				dialog.show();
				
				//dialog.removeItem(items.get(2));
			}
		};
		return listener;
	}
	/**
	 * 添加item
	 * @param info
	 */
	public void addItem(ItemInfo info){
		items.add(info);
		//刷新图标
		
	}
	
	

}
